package framework.editors
{

	public class XMLPropertyLister implements IPropertyLister
	{
		public function XMLPropertyLister()
		{
		}

		public function canList(obj:*):int
		{
			if (obj is XML || obj is XMLList)
				return 2;
			return 0;
		}

		public function isDynamic(obj:*):Boolean
		{
			return true;
		}

		public function list(obj:*):Array
		{
			var r:Array = [];
			for each (var f:Object in obj.children())
			{
				var op:ObjectProperty = new ObjectProperty;
				op.isComplex = f.elements().length() > 0;
				op.propName = f.name();
				r.push(op);
			}
			return r;
		}
	}
}